
clear;

Ds=16;
rCvM_b1K2=zeros(Ds,1);
rCvM_b1K5=zeros(Ds,1);
rCvM_b1K10=zeros(Ds,1);
rKS_b1K2=zeros(Ds,1);
rKS_b1K5=zeros(Ds,1);
rKS_b1K10=zeros(Ds,1);
rSUZ_b1=zeros(Ds,1);
rDn_b1=zeros(Ds,2);

rCvM_b2K2=zeros(Ds,1);
rCvM_b2K5=zeros(Ds,1);
rCvM_b2K10=zeros(Ds,1);
rKS_b2K2=zeros(Ds,1);
rKS_b2K5=zeros(Ds,1);
rKS_b2K10=zeros(Ds,1);
rSUZ_b2=zeros(Ds,1);
rDn_b2=zeros(Ds,2);

for ii=1:Ds
    if ii==1; load sim0520_n200_b1D1; end
    if ii==2; load sim0520_n400_b1D1; end
    if ii==3; load sim0520_n800_b1D1; end
    if ii==4; load sim0520_n1200_b1D1; end    
    if ii==5; load sim0520_n200_b1D2; end
    if ii==6; load sim0520_n400_b1D2; end
    if ii==7; load sim0520_n800_b1D2; end
    if ii==8; load sim0520_n1200_b1D2; end
    if ii==9; load sim0520_n200_b1D3; end
    if ii==10; load sim0520_n400_b1D3; end
    if ii==11; load sim0520_n800_b1D3; end
    if ii==12; load sim0520_n1200_b1D3; end
    if ii==13; load sim0520_n200_b1D4; end
    if ii==14; load sim0520_n400_b1D4; end
    if ii==15; load sim0520_n800_b1D4; end
    if ii==16; load sim0520_n1200_b1D4; end    
    rCvM_b1K5(ii)=mean(Tn_CvM>cv_CvM);
    rKS_b1K5(ii)=mean(Tn_KS>cv_KS);
    rSUZ_b1(ii)=mean(cv_SUZ);
    rDn_b1(ii,:)=[D,n];
end

for ii=1:Ds
    if ii==1; load sim0520_n200_b2D1; end
    if ii==2; load sim0520_n400_b2D1; end
    if ii==3; load sim0520_n800_b2D1; end
    if ii==4; load sim0520_n1200_b2D1; end    
    if ii==5; load sim0520_n200_b2D2; end
    if ii==6; load sim0520_n400_b2D2; end
    if ii==7; load sim0520_n800_b2D2; end
    if ii==8; load sim0520_n1200_b2D2; end
    if ii==9; load sim0520_n200_b2D3; end
    if ii==10; load sim0520_n400_b2D3; end
    if ii==11; load sim0520_n800_b2D3; end
    if ii==12; load sim0520_n1200_b2D3; end
    if ii==13; load sim0520_n200_b2D4; end
    if ii==14; load sim0520_n400_b2D4; end
    if ii==15; load sim0520_n800_b2D4; end
    if ii==16; load sim0520_n1200_b2D4; end    
    rCvM_b2K5(ii)=mean(Tn_CvM>cv_CvM);
    rKS_b2K5(ii)=mean(Tn_KS>cv_KS);
    rSUZ_b2(ii)=mean(cv_SUZ);
    rDn_b2(ii,:)=[D,n];
end

for ii=1:Ds
    if ii==1; load sim0520_K2n200_b1D1; end
    if ii==2; load sim0520_K2n400_b1D1; end
    if ii==3; load sim0520_K2n800_b1D1; end
    if ii==4; load sim0520_K2n1200_b1D1; end    
    if ii==5; load sim0520_K2n200_b1D2; end
    if ii==6; load sim0520_K2n400_b1D2; end
    if ii==7; load sim0520_K2n800_b1D2; end
    if ii==8; load sim0520_K2n1200_b1D2; end
    if ii==9; load sim0520_K2n200_b1D3; end
    if ii==10; load sim0520_K2n400_b1D3; end
    if ii==11; load sim0520_K2n800_b1D3; end
    if ii==12; load sim0520_K2n1200_b1D3; end
    if ii==13; load sim0520_K2n200_b1D4; end
    if ii==14; load sim0520_K2n400_b1D4; end
    if ii==15; load sim0520_K2n800_b1D4; end
    if ii==16; load sim0520_K2n1200_b1D4; end    
    rCvM_b1K2(ii)=mean(Tn_CvM>cv_CvM);
    rKS_b1K2(ii)=mean(Tn_KS>cv_KS);
end

for ii=1:Ds
    if ii==1; load sim0520_K2n200_b2D1; end
    if ii==2; load sim0520_K2n400_b2D1; end
    if ii==3; load sim0520_K2n800_b2D1; end
    if ii==4; load sim0520_K2n1200_b2D1; end    
    if ii==5; load sim0520_K2n200_b2D2; end
    if ii==6; load sim0520_K2n400_b2D2; end
    if ii==7; load sim0520_K2n800_b2D2; end
    if ii==8; load sim0520_K2n1200_b2D2; end
    if ii==9; load sim0520_K2n200_b2D3; end
    if ii==10; load sim0520_K2n400_b2D3; end
    if ii==11; load sim0520_K2n800_b2D3; end
    if ii==12; load sim0520_K2n1200_b2D3; end
    if ii==13; load sim0520_K2n200_b2D4; end
    if ii==14; load sim0520_K2n400_b2D4; end
    if ii==15; load sim0520_K2n800_b2D4; end
    if ii==16; load sim0520_K2n1200_b2D4; end    
    rCvM_b2K2(ii)=mean(Tn_CvM>cv_CvM);
    rKS_b2K2(ii)=mean(Tn_KS>cv_KS);
end

for ii=1:Ds
    if ii==1; load sim0520_K10n200_b1D1; end
    if ii==2; load sim0520_K10n400_b1D1; end
    if ii==3; load sim0520_K10n800_b1D1; end
    if ii==4; load sim0520_K10n1200_b1D1; end    
    if ii==5; load sim0520_K10n200_b1D2; end
    if ii==6; load sim0520_K10n400_b1D2; end
    if ii==7; load sim0520_K10n800_b1D2; end
    if ii==8; load sim0520_K10n1200_b1D2; end
    if ii==9; load sim0520_K10n200_b1D3; end
    if ii==10; load sim0520_K10n400_b1D3; end
    if ii==11; load sim0520_K10n800_b1D3; end
    if ii==12; load sim0520_K10n1200_b1D3; end
    if ii==13; load sim0520_K10n200_b1D4; end
    if ii==14; load sim0520_K10n400_b1D4; end
    if ii==15; load sim0520_K10n800_b1D4; end
    if ii==16; load sim0520_K10n1200_b1D4; end    
    rCvM_b1K10(ii)=mean(Tn_CvM>cv_CvM);
    rKS_b1K10(ii)=mean(Tn_KS>cv_KS);
end

for ii=1:Ds
    if ii==1; load sim0520_K10n200_b2D1; end
    if ii==2; load sim0520_K10n400_b2D1; end
    if ii==3; load sim0520_K10n800_b2D1; end
    if ii==4; load sim0520_K10n1200_b2D1; end    
    if ii==5; load sim0520_K10n200_b2D2; end
    if ii==6; load sim0520_K10n400_b2D2; end
    if ii==7; load sim0520_K10n800_b2D2; end
    if ii==8; load sim0520_K10n1200_b2D2; end
    if ii==9; load sim0520_K10n200_b2D3; end
    if ii==10; load sim0520_K10n400_b2D3; end
    if ii==11; load sim0520_K10n800_b2D3; end
    if ii==12; load sim0520_K10n1200_b2D3; end
    if ii==13; load sim0520_K10n200_b2D4; end
    if ii==14; load sim0520_K10n400_b2D4; end
    if ii==15; load sim0520_K10n800_b2D4; end
    if ii==16; load sim0520_K10n1200_b2D4; end    
    rCvM_b2K10(ii)=mean(Tn_CvM>cv_CvM);
    rKS_b2K10(ii)=mean(Tn_KS>cv_KS);
end

rRP_Ks=[rDn_b2,rCvM_b2K2,rCvM_b2K5,rCvM_b2K10,rSUZ_b2,...
                               rCvM_b1K2,rCvM_b1K5,rCvM_b1K10,rSUZ_b1];

Labela ={'DGP','n','K=2','K=5','K=10','SUZ','K=2','K=5','K=10','SUZ'};
mat2lat (rRP_Ks,'Table1.tex','columnlabels',Labela,...
        'format','%2.3f','size','footnotesize');   

    